import { defineStore } from 'pinia';

interface threeViewState {
  // threeScene: THREE.Scene,
  // camera: THREE.Camera,
  // renderer: THREE.WebGLRenderer,
  // fov: Number,
  // meshObj: Object,
  objArr: Array<THREE.Object3D>;//存放绘制的模型的数组---测高
  lineObjArr: Array<THREE.Object3D>;//存放线的模型数组---测高
  labelTextArr: Array<Object>;//存放标签模型的数组---测高
  pointArrObj: Array<THREE.Object3D>;//存放绘制的点模型的数组---测角度
  lineArrObj: Array<THREE.Object3D>;//存放绘制的线模型的数组---测角度
  pointArrVector3: Array<THREE.Vector3>;//存放vector3格式点坐标的数组---测角度
}

//定义Store函数
export const threeViewStore = defineStore('threeViewStore', {
  state: () => {
    const stateData: threeViewState = {
      // threeScene: {} as THREE.Scene,
      // camera: {} as THREE.Camera,
      // renderer: {} as THREE.WebGLRenderer,
      // fov: 0,
      // meshObj: {},
      objArr: [],
      lineObjArr: [],
      labelTextArr: [],
      pointArrObj: [],
      lineArrObj: [],
      pointArrVector3: [],
    };
    return stateData;
  },
  getters: {},
  actions: {
    saveAngleData(pointArrObj:Array<THREE.Object3D>,lineArrObj:Array<THREE.Object3D>,pointArrVector3:Array<THREE.Vector3>){
      this.pointArrObj = pointArrObj;
      this.lineArrObj =lineArrObj;
      this.pointArrVector3 = pointArrVector3;
    }
  }
});
